﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLL;
using Module;

namespace BLL
{
    public class BFamousRegionPaper
    {
        #region 字段

        private DFamousRegionPaper APP = new DFamousRegionPaper();//数据操作对象
        private static BFamousRegionPaper instance;

        #endregion

        #region 公共接口
        /// <summary>
        /// 取得
        /// </summary>
        /// <returns>BUserPassport对象</returns>
        public static BFamousRegionPaper getInstance()
        {
            if (instance == null)
            {
                instance = new BFamousRegionPaper();
            }
            return instance;
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="famousRegionPaperInfo"></param>
        /// <returns></returns>
        public bool Insert(FamousRegionPaperInfo famousRegionPaperInfo)
        {
            if (famousRegionPaperInfo == null || famousRegionPaperInfo.FamousRegionPaperId == 0)
                return false;
            return APP.Insert(famousRegionPaperInfo);

        }

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="famousRegionPaperInfo"></param>
        /// <returns></returns>
        public bool Update(FamousRegionPaperInfo famousRegionPaperInfo)
        {
             if (famousRegionPaperInfo == null || famousRegionPaperInfo.FamousRegionPaperId == 0)
                return false;
             return APP.Update(famousRegionPaperInfo);

        }

        /// <summary>
        /// 根据专区Id获取专区文章
        /// </summary>
        /// <param name="famousRegionId"></param>
        /// <returns></returns>
        public List<FamousRegionPaperInfo> GetFamousRegionPagers(long famousRegionId)
        {
            if (famousRegionId == 0 || famousRegionId.ToString().Length!=18)
                return null;

            return APP.GetFamousRegionPagers(famousRegionId);
        }

        /// <summary>
        /// 根据Id获取名人专区文章
        /// </summary>
        /// <param name="famousRegionPagerId"></param>
        /// <returns></returns>
        public FamousRegionPaperInfo GetFamousRegionPager(long famousRegionPagerId)
        {

            if (famousRegionPagerId == 0 || famousRegionPagerId.ToString().Length!=18)
                return null;

            return APP.GetFamousRegionPager(famousRegionPagerId);
        }

        /// <summary>
        /// 根据Id获取名人专区文章
        /// </summary>
        /// <param name="famousRegionPagerId"></param>
        /// <returns></returns>
        public List<FamousRegionPaperInfo> GetFamousRegionPagersByIds(long FamousRegionId, long CategoryId)
        {

            if (FamousRegionId == 0 || CategoryId == 0)
                return null;

            return APP.GetFamousRegionPagersByIds(FamousRegionId, CategoryId);
        }
        #endregion
    }
}
